package com.shj.em.biz.sell.entity;

import com.baomidou.mybatisplus.annotations.*;
import com.baomidou.mybatisplus.enums.IdType;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.shj.em.base.entity.BaseEntity;



import com.baomidou.mybatisplus.annotations.Version;

import com.shj.em.util.DateUtils;
import com.shj.em.util.StringUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 报价信息
 * </p>
 *
 * @author Shen Huang Jian
 * @since 2018-07-07
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("oa_quotation")
public class Quotation extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 报价单号
     */
    private String quotNo;

    /**
     * 日期
     */
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
    private Date quotDt;

    /**
     * 客户
     */
    private Long custId;

    private Long contactId;

    /**
     * 业务员
     */
    private String sellMan;

    /**
     * 备注
     */
    private String remark;

    /**
     * 是否已经转换成订单 0 - 未转换
     */
    private Integer convertFlag;

    @TableField(exist = false)
    private String custName;

    @TableField(exist = false)
    private String sellName;

    @TableField(exist = false)
    private BigDecimal totalPrice;

    public String getQuotDtStr(){
        return DateUtils.format(quotDt);
    }

    public String getTotalPriceStr(){
        return StringUtils.convertAmount2String(totalPrice, 2);
    }
}
